<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>标签详情界面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="static/css/font.css">
    <link rel="stylesheet" href="static/css/xadmin.css">
    <script type="text/javascript" src="static/js/jquery-3.3.1.js"></script>
    <script type="text/javascript" src="static/lib/layui/layui.js"></script>
    <script type="text/javascript" src="static/js/xadmin.js"></script>
    <style type="text/css">
        .layui-table-cell {
            height: auto;
            line-height: 20px;
            padding: 0 15px;
            position: relative;
            overflow: hidden;
            text-overflow: ellipsis;
            box-sizing: border-box;
            white-space: normal;   //nowrap=不换行   normal=正常
        }
    </style>
</head>

<body class="layui-anim layui-anim-up">

<div class="x-nav">
		<span class="layui-breadcrumb"> <a> <cite>指标对应详情描述</cite></a>
</div>
<div class="x-body" id="container">
    <div class="demoTable">
        <span style="color:#FF4500;font-size:15px">提示: 如下是每一个标签对应的详情，请参考</span>
    </div>
    <div style="text-align: center">
        <table id="demo" class="layui-table" lay-filter="demo"></table>
    </div>
    <!--id的隐藏域-->
    <input type="hidden" value="" id="dIdInput">
    <!--id的隐藏域-->
    <input type="hidden" value="" id="gTargetid">

</div>
</body>
<script>
    layui.use(['laydate','table'], function(){
        var laydate = layui.laydate
            ,table = layui.table;

        var gTargetid =decodeURI(getQueryVariable("gTargetid"));//评价指标项目ID
        console.log("详情描述gTargetid=" + JSON.stringify(gTargetid));

        var cols = [];
        cols.push({field:'gLtargetrmk', rowspan:1, title: '标签简称', width:230, align: 'center',fixed: 'left'});
        cols.push({field: 'gTargetname', rowspan:1, title: '标签详情', width:880, align: 'center',fixed: 'left'});

        //第一个实例
        table.render({
            elem: '#demo'
            ,height: 'full'
            ,url: 'empDepartmentScore/findTagDetailInfo.do?qTargetid='+gTargetid
            ,page: false
            ,initSort: {field: 'eAccount', type: 'desc'}
            ,id:'demo'
            ,cols: [cols]
        });

        var $ = layui.$, active = {
            reload: function () {
                var demoReload = $('#demoReload');
                //执行重载
                console.log(demoReload);
                table.reload('demo', {
                    where: {
                        e_id: $("#e_id").val()
                    }
                });
            }
        };
        $('.demoTable .layui-btn').on('click', function () {
            var type = $(this).data('type');
            console.log(type);
            active[type] ? active[type].call(this) : '';
        });




    });

    //获取父页面请求url传过来的参数
    function getQueryVariable(variable)
    {
        var query = window.location.search.substring(1);
        var index = query.indexOf("?");
        query = query.substr(index+1,query.length);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair[0] == variable){
                console.log(pair[1]);
                return pair[1];
            }
        }
        return false;
    }
</script>
</html>
